import Vue from 'vue'
// 国际化语言包
import VueI18n from 'vue-i18n'
// js的cookie包
import Cookies from 'js-cookie'
// element-ui 语言包
import ElementUIZH from 'element-ui/lib/locale/lang/zh-CN'
import ElementUIEN from 'element-ui/lib/locale/lang/en'

// 自定义语言包
import customEN from './en'
import customZH from './zh'
// 注册vuei18n
Vue.use(VueI18n)

export default new VueI18n({
  locale: Cookies.get('language') || 'zh',
  messages: {
    zh: {
      ...ElementUIZH,
      ...customZH
    },
    en: {
      ...ElementUIEN,
      ...customEN
    }
  }
})
